;;; GNU Guix --- Functional package management for GNU
;;;
;;; Copyright © 2021 florhizome <florhizome@posteo.net>
;;; Copyright © 2021, 2022 jgart <jgart@dismail.de>
;;; Copyright © 2022 Disseminate Dissent <disseminatedissent@protonmail.com>
;;;
;;; This file is not part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (guixrus packages misc)
  #:use-module (guix build utils)
  #:use-module (guix build-system cmake)
  #:use-module (guix build-system copy)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system go)
  #:use-module (guix build-system meson)
  #:use-module (guix build-system perl)
  #:use-module (guix build-system python)
  #:use-module (guix download)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages check)
  #:use-module (gnu packages curl)
  #:use-module (gnu packages lisp)
  #:use-module (gnu packages pcre)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages cpp)
  #:use-module (gnu packages file)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu packages gawk)
  #:use-module (gnu packages golang)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages gnupg)
  #:use-module (gnu packages groff)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages haskell-xyz)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages mail)
  #:use-module (gnu packages mercury)
  #:use-module (gnu packages ncurses)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages python-build)
  #:use-module (gnu packages python-check)
  #:use-module (gnu packages python-web)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages texinfo)
  #:use-module (gnu packages tex)
  #:use-module (gnu packages time)
  #:use-module (gnu packages boost)
  #:use-module (gnu packages version-control)
  #:use-module (gnu packages web-browsers)
  #:use-module (gnu packages xdisorg)
  #:use-module ((guixrus licenses) #:prefix license:)
  #:use-module ((guixrus packages common python) #:prefix rus:))

(define-public beautysh
  (package
    (name "beautysh")
    (version "6.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "beautysh" version))
       (sha256
        (base32 "0i6mnxhl3v48fx4hnd2q03rxy3wg6v444kjjjrm61lvshz5llswn"))))
    (build-system python-build-system)
    (arguments
     ;; Pypi release does not include tests and github release does not include
     ;; setup.py.
     `(#:tests? #f))
    (propagated-inputs
     (list
      python-colorama))
    (home-page "https://github.com/lovesegfault/beautysh")
    (synopsis "Bash beautifier for the masses")
    (description "@command{beautysh} beautifies bash scripts.  It can be called
from the command line or used as a module.  In tests with large GNU+Linux system
Bash scripts, its error-free score was ~99%.")
    (license license:expat)))

(define-public em-keyboard
  (package
    (name "em-keyboard")
    (version "2.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "em-keyboard" version))
       (sha256
        (base32 "1jygf1xi417v3dfl9gpyk3ajikljdl5mqnsjbhsz1dzv71nk91xj"))))
    (build-system python-build-system)
    (arguments
     ;; Tests require a running X session since they attempt to use pyperclip
     ;; to copy/paste to clipboard
     `(#:tests? #f))
    (propagated-inputs
     (list
      python-pyperclip))
    (native-inputs
     (list
      python-pytest
      python-pytest-cov
      python-setuptools-scm))
    (home-page "https://github.com/hugovk/em-keyboard")
    (synopsis "The CLI Emoji Keyboard")
    (description "@command{em-keyboard} is a nifty command-line utility for
referencing emoji characters by name.  Provide the names of a few emoji, and
those lucky chosen emojis will be displayed in your terminal, then copied to
your clipboard.  Automagically.")
    (license license:isc)))

(define-public twelve-tone
  (package
    (name "twelve-tone")
    (version "0.4.2")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "twelve-tone" version))
       (sha256
        (base32 "104037117hgk9g2xl16maxdxc7vihsx29ych0rx1rfv1bcg8pxi4"))))
    (build-system python-build-system)
    ;; TODO: enable tests
    (propagated-inputs
     (list
      python-click
      rus:python-miditime
      python-numpy))
    (home-page "https://github.com/accraze/python-twelve-tone")
    (synopsis "Twelve-tone cli app to generate dodecaphonic melodies")
    (description "Following a process created by Arnold Schoenberg, this library
computes a matrix to assist composers in creating twelve-tone melodies.")
    (license license:bsd-3)))

(define-public neatvi
  (package
    (name "neatvi")
    (version "10")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url "https://github.com/aligrudi/neatvi")
         (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32 "140j3835rm5bik96vm1hdbiqbrcb38z1lk7m6ahz13yyi1ydmrzn"))))
    (build-system gnu-build-system)
    (inputs
     (list
      bash))
    (arguments
     `(#:make-flags
       (list
        (string-append "CC=" ,(cc-for-target))
        (string-append "PREFIX=" %output))
       #:phases
       (modify-phases %standard-phases
         (delete 'configure)
         (replace 'install
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out  (assoc-ref outputs "out"))
                    (bin  (string-append out "/bin")))
               (install-file "vi" bin))))
         (replace 'check
           (lambda* (#:key tests? inputs outputs #:allow-other-keys)
             (when tests?
               (invoke "bash" "test.sh")))))))
    (home-page "http://litcave.rudi.ir/")
    (synopsis "Small vi/ex editor for editing bidirectional UTF-8 text")
    (description "@code{neatvi} is a vi/ex editor.  It can edit bidirectional
UTF-8 text.")
    (license license:isc)))

(define-public nextvi
  (let ((commit "31935f9f059a04db632beb101ab91984a879298d")
        (revision "0"))
    (package
      (name "nextvi")
      (version "10")
      (source
       (origin
         (method git-fetch)
         (uri
          (git-reference
           (url "https://github.com/kyx0r/nextvi")
           (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0yn301q0d5fzmr1l56215d31y8imahambqi5mpxrzfklf2sinmn0"))))
      (build-system gnu-build-system)
      (inputs
       (list
        bash
        coreutils))
      (arguments
       `(#:tests? #f                    ; There are no tests.
         #:make-flags
         (list
          (string-append "CC=" ,(cc-for-target))
          (string-append "PREFIX=" %output))
         #:phases
         (modify-phases %standard-phases
           (delete 'configure)
           (replace 'build
             (lambda* (#:key inputs ouputs #:allow-other-keys)
               (apply invoke `("gcc" "-c" "vi.c"  "-o" "vi"))))
           (replace 'install
             (lambda* (#:key inputs outputs #:allow-other-keys)
               (let* ((out  (assoc-ref outputs "out"))
                      (bin  (string-append out "/bin")))
                 (install-file "vi" bin)))))))
      (home-page "https://github.com/kyx0r/nextvi")
      (synopsis "Nextvi is a vi/ex editor")
      (description "Next version of @code{neatvi} (a small vi/ex editor) for
editing bidirectional UTF-8 text.")
      (license license:isc))))

(define-public migadu-cli
  (let ((commit "7866a0b035fea61832fe8d7734362fce1d2ae25d")
        (revision "0"))
    (package
      (name "migadu-cli")
      (version commit)
      (source
       (origin
         (method git-fetch)
         (uri
          (git-reference
           (url "https://github.com/jacksonrakena/migadu-cli")
           (commit commit)))
         (file-name (git-file-name name commit))
         (sha256
          (base32 "0vbdv3bllilq5kmrf6fajq8zgn82ibqdkp16lbv2pcdggfddvyvd"))))
      (build-system python-build-system)
      (inputs
        (list python-click python-requests))
      (arguments
        '(#:tests? #f ; No tests.
          #:phases
          (modify-phases %standard-phases
            (delete 'sanity-check)))) ; TODO Why does sanity-check fail?
      (home-page "https://github.com/jacksonrakena/migadu-cli")
      (synopsis "Command line tool for managing Migadu email hosting")
      (description
"@code{migadu-cli} is a command line tool for managing Migadu email
hosting.")
      (license license:expat))))

(define-public git-trend
  (package
    (name "git-trend")
    (version "0.5.5")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "git-trend" version))
        (sha256
          (base32 "1v3p536xqivnfb9qfwpi79227a7k31i90bcyqdq2h2bw1y1k4fzb"))))
    (build-system python-build-system)
    (inputs
      (list python-beautifulsoup4
            python-prettytable
            python-requests
            python-termcolor))
    (home-page "https://github.com/manojkarthick/git-trend")
    (synopsis "Get trending GitHub repos from the a CLI")
    (description
      "This package provides a Python CLI tool for fetching trending github
repositories and developers.")
    (license license:expat)))

(define-public git-pijul
  (package
    (name "git-pijul")
    (version "0.9.2")
    (source (origin
              (method url-fetch)
              (uri (pypi-uri "git-pijul" version))
              (sha256
               (base32
                "048w7snfjckrin492178xy6v6zgvd4zag43lv57x0m50vg3v9xvm"))))
    (build-system python-build-system)
    (propagated-inputs (list python-click rus:python-temppathlib python-toml
                             python-tqdm))
    (arguments
     `(#:tests? #f ;TODO
       #:phases
       (modify-phases %standard-phases
         (delete 'sanity-check)))) ;TODO Why does sanity-check fail?
    (home-page "https://github.com/ganwell/git-pijul")
    (synopsis "Update pijul from git")
    (description "Update pijul from git.")
    (license license:agpl3)))

(define-public go-github-com-matryer-is
  (package
    (name "go-github-com-matryer-is")
    (version "1.4.0")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/matryer/is")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0bs452ba2qh2a9ir7r8ixpf2slc6vpyg0041v9kn5c0d1zbb5wsc"))))
    (build-system go-build-system)
    (arguments
     `(#:import-path "github.com/matryer/is"))
    (home-page "https://github.com/pitr/jsontokenizer")
    (synopsis "Lightweight testing mini-framework for Go")
    (description
"@code{go-github-com-matryer-is} is a lightweight testing mini-framework
for Go.")
    (license license:expat)))

(define-public go-github-com-pitr-jsontokenizer
  (package
    (name "go-github-com-pitr-jsontokenizer")
    (version "0.2.0")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/pitr/jsontokenizer")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0ijz9y49av1vmlh0bkvbh5j2fi36b9a28jb56rric0wl8v0hldiw"))))
    (build-system go-build-system)
    (native-inputs (list go-github-com-matryer-is))
    (arguments
     `(#:import-path "github.com/pitr/jsontokenizer"))
    (home-page "https://github.com/pitr/jsontokenizer")
    (synopsis "Zero-allocation JSON tokenizer")
    (description
"@code{go-github-com-pitr-jsontokenizer} is a zero-allocation JSON
tokenizer.")
    (license license:expat)))

(define-public fj
  (package
    (name "fj")
    (version "0.2.0")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/pitr/fj")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "15pqivw8cib2y62aysqf0n1pi5ck0y6ipnkalljvfapj3zpp0dcv"))))
    (build-system go-build-system)
    (native-inputs (list go-github-com-matryer-is))
    (inputs
      (list go-github-com-valyala-bytebufferpool
            go-github-com-pitr-jsontokenizer))
    (arguments
     `(#:import-path "github.com/pitr/fj"))
    (home-page "https://github.com/pitr/fj")
    (synopsis "Flatten JSON")
    (description
"@code{fj} flattens JSON into a value and its full path per line, so
data can be worked on using UNIX tools such as @code{grep}, @code{awk},
@code{cut}, etc.")
    (license license:expat)))

(define-public gotags
  (package
    (name "gotags")
    (version "1.4.1")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/jstemmer/gotags")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "1h7jrpjzlpm0k8b3yb02rsgxvlswabffhi301n6jxsfnxjvy0x3h"))))
    (build-system go-build-system)
    (arguments
     `(#:import-path "github.com/jstemmer/gotags"))
    (home-page "https://github.com/jstemmer/gotags")
    (synopsis "Ctags-compatible tag generator for Go")
    (description "@code{gotags} is a ctags-compatible tag generator for Go.")
    (license license:expat)))

(define-public ascii2tex
  (let ((commit "83000d57010ffb393bb7f27f519ee48656e16346")
        (revision "0"))
    (package
      (name "ascii2tex")
      (version commit)
      (source
       (origin
         (method git-fetch)
         (uri
          (git-reference
           (url "https://github.com/kcolford/ascii2tex")
           (commit commit)))
         (file-name (git-file-name name commit))
         (sha256
          (base32 "0bn7xzpz8j5bnc47818vijnd6z2zayzy97854ljx8y7z7lqqa51z"))))
      (build-system gnu-build-system)
      (arguments
        `(#:tests? #f ; no tests
          #:make-flags
          (list (string-append "CC=" ,(cc-for-target)))
          #:phases
          (modify-phases %standard-phases
            (delete 'configure)
            (replace 'install
              (lambda* (#:key inputs outputs #:allow-other-keys)
                (let* ((out (assoc-ref outputs "out"))
                       (bin (string-append out "/bin")))
                  (install-file "ascii2tex" bin)))))))
      (home-page "https://github.com/kcolford/ascii2tex")
      (synopsis "Generate plain TeX formatted ascii text with a pipe")
      (description
"@code{ascii2tex} generates plain Tex formatted ascii texti with a pipe.")
      (license license:gpl3+))))

(define-public roman-to-kana
  (let ((commit "50a4b5a044f8efaf7daa8560d8bc6002279f2849")
        (revision "0"))
    (package
      (name "roman-to-kana")
      (version commit)
      (source
       (origin
         (method git-fetch)
         (uri
          (git-reference
           (url "https://github.com/klampworks/roman-to-kana")
           (commit commit)))
         (file-name (git-file-name name commit))
         (sha256
          (base32 "1j5k6i59n41pq0zhnl3v59iz7g6h42nja6hd6j0s5ld7rrfyzzi2"))))
      (build-system gnu-build-system)
      (arguments
        `(#:tests? #f ; no tests
          #:make-flags
          (list (string-append "CC=" ,(cc-for-target)))
          #:phases
          (modify-phases %standard-phases
            (add-after 'unpack 'create-makefile
              (lambda* (#:key outputs #:allow-other-keys)
                (with-output-to-file "Makefile"
                  (lambda _
                    (format #t
                            "~@
                            CFLAGS = -O3~@
                            LDFLAGS = -s~@
                            all: roman_to_kana~@
                            .PHONY: all~@
                            ")))))
            (delete 'configure)
            (replace 'install
              (lambda* (#:key inputs outputs #:allow-other-keys)
                (let* ((out (assoc-ref outputs "out"))
                       (bin (string-append out "/bin")))
                  (install-file "roman_to_kana" bin)))))))
      (home-page "https://github.com/klampworks/roman-to-kana")
      (synopsis "Tool for converting roman text to kana")
      (description
"@code{roman-to-kana} is a tool for converting roman (English) text to
kana (Japanese).

The first command line argument is taken as the input string:

@command{roman_to_kana \"text to be translated\"}")
      (license license:gpl2+))))

(define-public libcsv
  (let ((commit "b1d5212831842ee5869d99bc208a21837e4037d5")
        (revision "0"))
    (package
      (name "libcsv")
      (version commit)
      (source
       (origin
         (method git-fetch)
         (uri
          (git-reference
           (url "https://github.com/rgamble/libcsv")
           (commit commit)))
         (file-name (git-file-name name commit))
         (sha256
          (base32 "0nni9y0prz8lh3dywbha52yfg8qcf3dn0nb7iinfwlrmmamfyzg2"))))
      (build-system gnu-build-system)
      (arguments
        `(#:make-flags
          (list (string-append "CC=" ,(cc-for-target)))))
      (home-page "https://github.com/rgamble/libcsv")
      (synopsis "CSV library written in pure ANSI C")
      (description
"CSV library written in pure ANSI C that can read and write CSV data.")
      (license license:lgpl2.1+))))

(define-public httpflow
    (package
      (name "httpflow")
      (version "0.0.9")
      (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://github.com/six-ddc/httpflow")
                (commit version)))
          (file-name (git-file-name name version))
          (sha256
           (base32
            "0s0rq14szpnvfaknknvk9mniphngp018w82vxjcl5yyng37biwyg"))))
      (build-system gnu-build-system)
      (arguments
        `(#:tests? #f ; There are no tests.
          #:make-flags
          (list
           (string-append "PREFIX="
                          (assoc-ref %outputs "out"))
           (string-append "CC=" ,(cc-for-target)))
          #:phases
          (modify-phases %standard-phases
            (delete 'configure))))
      (inputs
        (list zlib libpcap pcre))
      (home-page "https://github.com/six-ddc/httpflow")
      (synopsis "Capture and dump HTTP streams from the command line")
      (description
"@code{httpflow} is a command line utility that helps to capture and dump
an HTTP stream.")
      (license license:expat)))

(define-public scheme-texinfo
  (let ((commit "04a0827f5f502fe421b9edfe73b7ddccb4a3b40d")
        (revision "0"))
    (package
      (name "scheme-texinfo")
      (version commit)
      (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://github.com/remvee/scheme-texinfo")
                (commit commit)))
          (file-name (git-file-name name version))
          (sha256
           (base32
            "0a103mh7dbcbi7dv075kikj0i9xx0y05ng1lzzqi787zwb3w001i"))))
      (build-system gnu-build-system)
      (arguments
        `(#:make-flags
          (list
           (string-append "PREFIX=" %output)
           (string-append "INFODIR=" %output "/share/info"))
          #:phases
          (modify-phases %standard-phases
            (delete 'bootstrap)
            (delete 'configure)
            (add-before 'build 'prepare-install-directories
              (lambda* (#:key outputs #:allow-other-keys)
                (let ((out (assoc-ref outputs "out")))
                  (mkdir-p (string-append out "/share/info")))))
            (delete 'check))))
      (native-inputs
        (list texinfo))
      (home-page "https://github.com/remvee/scheme-texinfo")
      (synopsis "Texinfo files about Scheme")
      (description
"@code{scheme-texinfo} provides texinfo files from

* SICP: http://www.neilvandyke.org/sicp-texi/
* R5RS: ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/standards/")
      (license license:none))))

(define-public tablign
  (package
    (name "tablign")
    (version "0.3.4")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "tablign" version))
        (sha256
          (base32 "1hircmm7frqis5m7rgdgf80s3ra1pwzvzkhgypkbjasf0pz742s2"))))
    (build-system python-build-system)
    (arguments
      `(#:tests? #f
          #:phases
          (modify-phases %standard-phases
            (add-after 'unpack 'create-setup-py
              (lambda* (#:key outputs #:allow-other-keys)
                (with-output-to-file "setup.py"
                  (lambda _
                    (format #t
                            "~@
                             from setuptools import setup; setup()~@
                             "))))))))
    (propagated-inputs
      (list python-importlib-metadata))
    (home-page "https://github.com/nschloe/tablign")
    (synopsis "Align columns in ASCII tables")
    (description
"Aligns columns in your ASCII tables on the command line or in vim.")
    (license license:gpl3+)))

(define-public kdenchapters
  (let ((commit "f4b5fd5b9e6b20181ce3de295a044ea6e35bbb72")
        (revision "0"))
    (package
      (name "kdenchapters")
      (version "0")
      (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://github.com/BrodieRobertson/kdenchapters")
                (commit commit)))
          (file-name (git-file-name name version))
          (sha256
           (base32
            "1lkrhw4l3dqlfzwdiziczykbk0b1bkjjmqhmvbkq1qpphandr119"))))
      (build-system python-build-system)
      (arguments
        `(#:tests? #f ; no tests
            #:phases
            (modify-phases %standard-phases
              (add-after 'unpack 'create-setup-py
                (lambda* (#:key outputs #:allow-other-keys)
                  (with-output-to-file "setup.py"
                    (lambda _
                      (format #t
                              "~@
                               from setuptools import setup; setup()~@
                               ")))))
              (add-after 'unpack 'change-to-build-dir
                (lambda _
                  (patch-shebang "kdenchapters")))
              (replace 'install
                (lambda* (#:key outpus #:allow-other-keys)
                  (let ((bin (string-append (assoc-ref %outputs "out") "/bin")))
                    (install-file "kdenchapters" bin)))))))
      (home-page "https://github.com/BrodieRobertson/kdenchapters/")
      (synopsis "Extract YouTube chapter timestamps from a kdenlive project file")
      (description
"@code{kdenchapters} extracts out time stamps from a video editor project
file in the format used by YouTube.")
      (license license:none)))) ; https://github.com/BrodieRobertson/kdenchapters/issues/1

(define-public 2048-cli
    (package
      (name "2048-cli")
      (version "0.9.1")
      (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://github.com/tiehuis/2048-cli")
                (commit (string-append "v" version))))
          (file-name (git-file-name name version))
          (sha256
           (base32
            "09nv10np0jiaw4qj0ar3ny2m9ba8jwa3x7kqlfq0zb28559apcx4"))))
      (build-system gnu-build-system)
      (arguments
        `(#:tests? #f ; There are no tests.
          #:make-flags
          (list
           (string-append "PREFIX="
                          (assoc-ref %outputs "out"))
           (string-append "CC=" ,(cc-for-target)))
          #:phases
          (modify-phases %standard-phases
            (delete 'configure)
            (replace 'install
              (lambda* (#:key inputs outputs #:allow-other-keys)
                (let* ((out (assoc-ref outputs "out"))
                       (bin (string-append out "/bin")))
                  (install-file "2048" bin)))))))
      (home-page "https://github.com/tiehuis/2048-cli")
      (synopsis "2048 game for your Linux terminal")
      (description "A CLI version of the game 2048 for your Linux terminal.")
      (license license:expat)))

(define-public npm
    (package
      (name "npm")
      (version "0.1")
      (source
       (origin
         (method git-fetch)
         (uri
          (git-reference
           (url "https://github.com/noocsharp/npm")
           (commit (string-append "v" version))))
         (file-name (git-file-name name version))
         (sha256
          (base32 "1fp24qiqfal25rqmfn27wq75vb1jnjzvn1h3hjixnzcaxhvilbhj"))))
      (build-system gnu-build-system)
      (arguments
       `(#:tests? #f ; There are no tests.
         #:make-flags
         (list
          (string-append "CC=" ,(cc-for-target))
          (string-append "PREFIX=" %output))
          #:phases
          (modify-phases %standard-phases
            (delete 'configure)
            #;(replace 'patch-source-shebangs
              (lambda _
                (patch-shebang "."))))))
      (home-page "https://github.com/noocsharp/npm/")
      (synopsis "Nihal's Password Manager")
      (description
"@code{npm} is a password manager based on a modified version of
@code{pash} where gpg is replaced by @code{npm-core} and @code{npmc}.")
      (license license:expat)))

(define-public python-veryprettytable
  (package
    (name "python-veryprettytable")
    (version "0.8.1")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "veryprettytable" version))
        (sha256
          (base32 "1k1rifz8x6qcicmx2is9vgxcj0qb2f5pvzrp7zhmvbmci3yack3f"))))
    (build-system python-build-system)
    (propagated-inputs (list python-colorama python-termcolor))
    (home-page "https://github.com/smeggingsmegger/VeryPrettyTable")
    (synopsis "Library for displaying tabular data in a ASCII table format")
    (description
      "This package provides a simple Python library for easily displaying tabular data
in a visually appealing ASCII table format")
    (license license:expat)))

(define-public pirate-get
  (package
    (name "pirate-get")
    (version "0.4.1")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "pirate-get" version))
        (sha256
          (base32 "0pr703fwinr2f4rba86zp57mpf5j2jgvp5n50rc5vy5g7yfwsddm"))))
    (build-system python-build-system)
    (propagated-inputs
      (list python-colorama python-pyperclip python-veryprettytable))
    (home-page "https://github.com/vikstrous/pirate-get")
    (synopsis "A command line interface for The Pirate Bay")
    (description
      "This package provides a command line interface for The Pirate Bay")
    (license license:gpl1)))

(define-public bibman
  (package
    (name "bibman")
    (version "0.4")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
        (url "https://github.com/maciejjan/bibman")
        (commit (string-append version "-alpha"))))
        (file-name (git-file-name name version))
       (sha256
        (base32 "0489r17slklkvg1g852slmywsq97657nyipqjvxnih1r0dwf1iz7"))))
    (build-system perl-build-system)
    (arguments
      `(#:tests? #f)) ; no tests
    (inputs
      (list perl-curses perl-text-bibtex perl-try-tiny ncurses))
    (synopsis "Console tool for managing BibTeX files")
    (description
"Bibman (BIBliography MANager) is a small console tool for managing
BibTeX files.  Its functionality is meant to be similar to JabRef and
its user interface is inspired by @code{vim}.  It enables quick searching,
filtering, editing, sorting etc. of bibliography entries using a
text-mode, keyboard-only interface.  It stores bibliographies in plain
BibTeX files and uses only standard fields.")
    (home-page "https://github.com/maciejjan/bibman/")
    (license license:gpl3+)))

(define-public toml11
  (package
    (name "toml11")
    (version "3.7.0")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url "https://www.github.com/ToruNiina/toml11")
         (commit (string-append "v" version))))
       (sha256
        (base32 "10im03s1j5ay3a7f0j3xs8bj8zzjanqza5mm90i59nhxdnp4mz50"))))
    (native-inputs
     (list git-minimal pkg-config boost)) ;;git and boost are for tests
    (build-system cmake-build-system)
    ;;(arguments `(#:configure-flags '("-Dtoml11_BUILD_TEST=ON"))) tests need toml repo
    (synopsis "A toml parser for modern C++")
    (description "@{code}toml11 is a toml parser for modern C++.")
    (home-page "https://www.github.com/ToruNiina/toml11")
    (license license:expat)))

(define-public abcm2ps
  (package
   (name "abcm2ps")
   (version "8.14.13")
   (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/lewdlime/abcm2ps")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32
         "0yybv0wg6ss624x9yy4b13z808hgnhjldr63496nkv37sl308myz"))))
   (build-system gnu-build-system)
   (inputs
    (list pango freetype))
   (native-inputs
    (list pkg-config python-docutils))
   (arguments
    `(#:tests? #f ; no tests
      #:make-flags
      (list
       (string-append "INSTALL="
                      (assoc-ref %outputs "out"))
       (string-append "CC=" ,(cc-for-target))
       (string-append "PKG_CONFIG=" ,(pkg-config-for-target)))
       #:phases
       (modify-phases %standard-phases
         (replace 'install
           (lambda* (#:key outpus #:allow-other-keys)
             (let ((bin (string-append (assoc-ref %outputs "out") "/bin"))
                   (man (string-append (assoc-ref %outputs "out") "/share/man/man1")))
               (install-file "abcm2ps" bin)
               (install-file "abcm2ps.1" man)))))))
   (home-page "http://moinejf.free.fr/")
   (synopsis "CLI program which converts ABC notation to sheet music")
   (description
    "@command{abcm2ps} (Fucking Fast File-Manager) is a simple, blazing fast and minimal
file manager for Linux, written in bash.  It only requires bash and coreutils,
and its highly optimized now for efficient performance.")
   (license license:lgpl3+)))

(define-public agenda
  (let ((commit "e89de38b8b65f4dea2b30610b73c319254eb25c5")
        (revision "0"))
  (package
    (name "agenda")
    (version (git-version "0" revision commit))
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/rougier/agenda")
             (commit commit)))
       (file-name (git-file-name name version))
       (sha256
        (base32
         "0xr62f0w5lkqazbac0gwxakyz4jk023an8d0n7f22n9q6flm5g6i"))))
    (build-system python-build-system)
    (arguments
      `(#:tests? #f ; There are no tests.
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'create-setup-py
            (lambda* (#:key outputs #:allow-other-keys)
              (with-output-to-file "setup.py"
                (lambda _
                  (format #t
                          "~@
                           from setuptools import setup; setup(py_modules=['agenda', 'style', 'terminal'])~@
                           ")))))
        (add-after 'install 'install-agenda-executable
             (lambda* (#:key inputs outputs #:allow-other-keys)
               (let* ((out (assoc-ref outputs "out"))
                      (bin (string-append out "/bin")))
                 (install-file "agenda" bin)))))))
    (inputs
      (list python-orgparse
            python-holidays))
    (home-page "https://github.com/rougier/agenda")
    (synopsis "Org agenda in the console")
    (description
"@code{agenda} reads an org agenda file and displays an interactive and
colored year calendar with detailed information for each day when the
mouse hovers a specific date.  Else, it shows the event for the current week.")
    (license license:gpl3+))))

(define-public python-korean-lunar-calendar
  (package
    (name "python-korean-lunar-calendar")
    (version "0.2.1")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "korean_lunar_calendar" version))
        (sha256
          (base32 "0p97r21298ipgvsqh978aq2n6cvybzp8bskcvj15mm1f76qm9khj"))))
    (build-system python-build-system)
    (home-page "https://github.com/usingsky/korean_lunar_calendar_py")
    (synopsis "Korean Lunar Calendar")
    (description "Korean Lunar Calendar")
    (license license:expat)))

(define-public python-hijri-converter
  (package
    (name "python-hijri-converter")
    (version "2.2.3")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "hijri-converter" version))
        (sha256
          (base32 "10nk8ax93khbmn3sb7k93nrm4wiwb6zqkv490vs7nr6axkn9q577"))))
    (build-system python-build-system)
    (home-page "https://github.com/mhalshehri/hijri-converter")
    (synopsis
      "Accurate Hijri-Gregorian dates converter based on the Umm al-Qura calendar")
    (description
      "Accurate Hijri-Gregorian dates converter based on the Umm al-Qura calendar")
    (license license:expat)))

(define-public python-build
  (package
    (name "python-build")
    (version "0.7.0")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "build" version))
        (sha256
          (base32 "17xqija27x4my1yrnk6q2vwln60r39g2dhby9zg2l99qjgbdrahs"))))
    (build-system python-build-system)
    (propagated-inputs (list python-packaging python-pep517 python-tomli))
    (native-inputs
      (list python-filelock
            python-pytest
            python-pytest-cov
            python-pytest-mock
            python-pytest-rerunfailures
            python-pytest-xdist
            python-setuptools
            python-toml
            python-wheel))
    (home-page "")
    (synopsis "A simple, correct PEP517 package builder")
    (description
      "This package provides a simple, correct PEP517 package builder")
    (license license:expat)))

(define-public python-pymeeus
  (package
    (name "python-pymeeus")
    (version "0.5.11")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "PyMeeus" version))
        (sha256
          (base32 "0mgdiwf026jf0pr3n9j4ad75k802xanpv2ml2x1mkc6q3046g7dv"))))
    (build-system python-build-system)
    (home-page "https://github.com/architest/pymeeus")
    (synopsis "Python implementation of Jean Meeus astronomical routines")
    (description "Python implementation of Jean Meeus astronomical routines")
    (license license:lgpl3+)))

(define-public python-convertdate
  (package
    (name "python-convertdate")
    (version "2.4.0")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "convertdate" version))
        (sha256
          (base32 "13xl4rpwy13a62bghxxqh0kd07hjkcf3y2r33r2kwkaljlhnn33p"))))
    (build-system python-build-system)
    (propagated-inputs (list python-pymeeus))
    (native-inputs
      (list python-black
            python-build
            python-censusgeocode
            python-coverage
            python-isort
            python-pylint))
    (home-page "https://github.com/fitnr/convertdate")
    (synopsis "Converts between Gregorian dates and other calendar systems")
    (description "Converts between Gregorian dates and other calendar systems")
    (license license:expat)))

(define-public python-holidays
  (package
    (name "python-holidays")
    (version "0.13")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "holidays" version))
        (sha256
          (base32 "0p372199qshv6nfx7d1cm77ipmkwsfa1v4ys09kq156siamw7xy6"))))
    (build-system python-build-system)
    (propagated-inputs
      (list python-convertdate
            python-dateutil
            python-hijri-converter
            python-korean-lunar-calendar))
    (home-page "https://github.com/dr-prodigy/python-holidays")
    (synopsis "Generate and work with holidays in Python")
    (description "Generate and work with holidays in Python")
    (license license:expat)))

(define-public python-censusgeocode
  (package
    (name "python-censusgeocode")
    (version "0.5.2")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "censusgeocode" version))
        (sha256
          (base32 "0f6yxm3dmga5q2d4indjbz4h5xdbfajxy2p6lss31ih6g0dhsngf"))))
    (build-system python-build-system)
    (arguments
      `(#:tests? #f
        #:phases
        (modify-phases %standard-phases
          (delete 'sanity-check)))) ; TODO Why does sanity-check fail?
    (propagated-inputs (list python-requests python-requests-toolbelt))
    (native-inputs (list python-vcrpy))
    (home-page "https://github.com/fitnr/censusgeocode")
    (synopsis "Thin Python wrapper for the US Census Geocoder")
    (description "Thin Python wrapper for the US Census Geocoder")
    (license license:gpl3+)))

(define-public python-py2puml
  (package
    (name "python-py2puml")
    (version "0.6.0")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "py2puml" version))
        (sha256
          (base32 "1mymdqzqhfnvqb88m4xjxani1qdlga2r14yqmxzk46qvf2mqmllw"))))
    (build-system python-build-system)
    (home-page "https://github.com/lucsorel/py2puml")
    (synopsis
      "Generate PlantUML class diagrams to document your Python application.")
    (description
      "Generate PlantUML class diagrams to document your Python application.")
    (license license:expat)))

(define-public guitar-scale-chart
  (let ((commit "7968569d9e87a376489f71b99290217ed99b6699")
        (revision "0"))
    (package
      (name "guitar-scale-chart")
      (version "0.9.1")
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/jgarte/guitar-scale-chart")
                      (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "1ms34r7h78mv8v8z9n5dhwnlz61ckgjby962kv0mz40vhb47yv3h"))))
      (build-system perl-build-system)
      (propagated-inputs
        (list perl-list-allutils ; fails to find moreutils
              perl-term-ansicolor))
      (home-page "https://github.com/mizlan/guitar-scale-chart/")
      (synopsis "Pretty guitar scales in your terminal")
      (description
"@code{guitar-scale-chart} is a script to display guitar scales across
the fretboard.")
      (license license:expat))))

(define-public jpm
  (package
    (name "jpm")
    (version "1.1.0")
    (source
      (origin
        (method git-fetch)
        (uri (git-reference
               (url "https://github.com/janet-lang/jpm")
               (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
         (base32 "05rdxigmiy7vf93s16a8n2029lq33073jccz1rjl4iisxj6piw4l"))
         (snippet
               '(begin
                  ;; Delete configs for other operating systems.
                  (for-each delete-file '("configs/bsd_config.janet"
                                          "configs/linux_config.janet"
                                          "configs/macos_config.janet"
                                          "configs/msvc_config.janet"
                                          "configs/msvc_config.jdn"))))))
    (build-system copy-build-system)
    (arguments
     '(#:phases
       (modify-phases %standard-phases
         #;(add-after 'unpack 'patch-config-file
                    (lambda* (#:key outputs #:allow-other-keys)
                      (let ((prefix (assoc-ref outputs "out")))
                        (substitute* "configs/linux_config.janet"
                          (("/usr/local") prefix)
                          ((":auto-shebang true") ":auto-shebang false")))))
         (replace 'install
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((store (assoc-ref outputs "out")))
               (setenv "PREFIX=" store)
               (setenv "DESTDIR=" store)
               (invoke "janet"
                       "bootstrap.janet")))))))
    (native-inputs
     (list pkg-config))
    (inputs
     (list git curl janet))
    (home-page "https://github.com/janet-lang/jpm")
    (synopsis "Janet Project Manager")
    (description "@code{jpm} is the Janet Project Manager tool.")
    (license license:expat)))

(define-public stack-overflow-import
  (package
    (name "stack-overflow-import")
    (version "0.1.2")
    (source (origin
              (method url-fetch)
              (uri (pypi-uri "stackoverflow" version))
              (sha256
               (base32
                "0bpm04qzcvwan2dsz35kifjy7hllzs6nc9vgrqyir99v0qflmaiv"))))
    (build-system python-build-system)
    (propagated-inputs (list python-beautifulsoup4 python-requests))
    (home-page "https://github.com/drathier/stack-overflow-import")
    (synopsis "Easily use code directly from Stack Overflow")
    (description "Easily use code directly from Stack Overflow.")
    (license license:wtfpl2)))

